When using Python's unittest to test an class an strange error occurs